package com.itheima.tlias84.po;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class InsertStudentParam {
    @NotNull(message = "名字不能为空")
    @Length(min = 2,max = 10,message = "名字长度为[2,10]")
    private String name;
    @NotNull(message = "手机号不能为空")
    @Length(min = 10 ,max = 10,message = "学号必须为10位数字")
    private String no;
    private int gender;
    @NotNull(message = "手机号不能为空")
    @Length(min = 11 ,message = "手机号长度11位")
    @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号格式错误")
    private String phone;
    @NotNull(message = "省份证号不能为空")
    @Length(min =  18,message = "身份证号为18位")
    private String idCard;
    private int isCollege;
    private String address;
    private Integer degree;
    private LocalDate graduationDate;
    private Integer clazzId;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

}
